package com.whpost.admin.controller.stamp.h5;

import jakarta.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/h5/sp")
public class SpController {

//    @RequestMapping(value="/1")
//    public String bg(Model model, HttpServletRequest httpServletRequest) {
//        return "stamp/h5/sp/1";
//    }
//
//    @RequestMapping(value="/2")
//    public String bg2(Model model, HttpServletRequest httpServletRequest) {
//        return "stamp/h5/sp/2";
//    }
//
//    @RequestMapping(value="/hhl")
//    public String hhl(Model model, HttpServletRequest httpServletRequest) {
//        return "stamp/h5/sp/hhl";
//    }

    @RequestMapping(value = "/{variable}")
    public String handleRequest(@PathVariable String variable,Model model) {

        System.out.println("这里获取的variable:"+variable);
        if ("hhl".equals(variable)) variable="2";
        // 这里的variable就是URL中对应的部分
        model.addAttribute("sp", variable);
        return "stamp/h5/sp/sp";
    }
}
